<?php if(isset($obj->access) && $obj->access['allow'] == true){ $access = $obj->access;?>
<div id="toolbar-box">
    <div class="toolbar" id="toolbar">
	<table class="toolbar">
            <tr>
				<?php if($access['allow_write'] == true){ ?>
					<td class="button" id="toolbar-new">
					<a  href="/admin/addtovar.html?cat=<?=$obj->cat?>" class="toolbar">
					<span class="icon-32-new" title="New">
					</span>
					Додати
					</a>
					</td>
               <?php } ?>
            </tr>
       </table>
</div>
   <div class="clear"></div>
</div>
<div class="clear"></div>
	<div style="padding-left:20px;"><?=$obj->link?></div>
<div id="element-box">
			<div class="m">				
				<form action="" method="post" name="adminForm">
				<table class="adminlist">
					<thead>
						<tr>
							<th width="20px">#</th>
							<th width="15px" align="left">
								<input type="checkbox" id="toggle" name="toggle" value="" onclick="CheckAll();" />
							</th>
							<th class="title">Назва</th>
							<th class="title">Превью</th>
							<th width="5%">Посилання</th>
						<?php if($access['allow_edit'] == true){ ?>
							<th width="5%">Ред.</th>
							<th width="5%">Наст.</th>
                        <?php } if($access['allow_delete'] == true){ ?>
							<th width="5%">Видалити</th>
                        <?php } ?>
							<th width="8%" nowrap="nowrap">Порядок</th> 
							<th width="1%" nowrap="nowrap">Пункт ID</th>
						</tr>
					</thead>
					<tfoot>
						<tr>
							<td colspan="12">
    <div class="pagination">
	<?//=$obj->pager['pager']?>
    </div>
		<div class="pagecounter"></div>
			</td>
				</tr>
					</tfoot>
					<tbody>
						<!-- CONTENT -->
						<?php $i=1; foreach($obj->goods as $value){ ?>
						<tr class="row<?=$i?>" id='row<?=$value['id']?>'>
							<td><?=$i?></td>
							<td width="15px" align="left">
								<input type="checkbox" id="checkme<?=$i?>" name="cid[]" value="<?=$value['id']?>"/>
							</td>
							<td>
								<span class="editlinktip hasTip" title="Клікніть для перегляду зображень::<?=$value['name']?>">
								<a href="<?="/admin/images.html?id=".$value['id']?>"><?=$value['name']?></a></span>
							</td>
							<td>
								<img src='/public/upload/goods/<?=$value['small']?>' border="0" width="66px"/>
							</td>
							<td>
								<a style='padding-left:5px;' href="#" onclick="SwhowBox('<?=BASE_URL.'/'.$value['group'].'/'.$value['subcat'].'/'.$value['url'];?>','Посилання');"><img src="/public/images/admin/icons/btn_file_bottom_link.gif" border="0" width="22px" height="15px"></a>
							</td>
                   <?php if($access['allow_edit'] == true){ ?>
							<td>
								<a style='padding-left:5px;' href="/admin/edt.html?id=<?=$value['id']?>"><img src="/public/images/edit.png" border="0" width="16px" height="16px"></a>
							</td>
							<td>
								<a style='padding-left:5px;' href="/admin/sdt.html?id=<?=$value['id']?>"><img src="/public/images/gear.png" border="0" width="16px" height="16px"></a>
							</td>
                   <?php } if($access['allow_delete'] == true){ ?>
							<td>
								<span style='padding-left:5px;cursor:pointer;' id='delgoods<?=$value['id']?>' onclick="actions(<?=$value['id']?>,'delgoods');"><img src="/public/images/delete.jpg"  border="0" width="16px" height="16px"></span>
							</td>
                   <?php } ?>
							<td class="order" nowrap="nowrap">
                                <span><img src="/public/images/admin/downarrow.png" width="16" height="16" border="0" alt="Поднять вверх" onclick="actions(<?=$value['id']?>,'top');" style='cursor:pointer;'/></span>
                                <input type="text" name="top" id='top<?=$value['id']?>' size="5" value="<?=$value['sort']?>" title='<?=$value['sort']?>'  class="text_area" style="text-align: center;width:30px;" />
							</td>
							<td align="center"><?=$value['id']?></td>
						</tr>
						<?php $i++;} ?>
						<!-- END CONTENT -->
					</tbody>
					</table>
				</form>
				<div class="clear"></div>
			</div>
</div>
<div id="result"></div>
<?php }else{
echo"<div align='center'>
<img src='/public/images/admin/access_denied.png' border='0' width='256px' height='256px' /><br>
<span style='padding-left:10px;'><font size='5px' color='red'>
<stong>Доступ заборонено!</stong>
</font>
<br>
У вас недостатньо повноважень для доступу до каталогу товарів!
</span>
</div>";
} ?>
